import Vue from 'vue'
import VueRouter from 'vue-router'
import routes from './router/router'
Vue.use(VueRouter)
import store from './store/'
import {routerMode} from './config/env'

import Element from 'element-ui';
import 'element-ui/lib/theme-default/index.css';
Vue.use(Element);

// 注册全局组件
// import componentsVendor from './components/componentsVendor'
// Vue.use(componentsVendor);
// import componentsVendorGreen from './components/componentsVendorGreen'
// Vue.use(componentsVendorGreen);
import componentsVendorBlue from './components/componentsVendorBlue'
Vue.use(componentsVendorBlue);

//字体图标
import "./fonts/iconfont.css";

//引入healthTrend中的css
import './res/css/app.css';
import './res/css/app_ty.css';
import './res/css/bootstrap.css';
import './res/css/cdm.css';
import './res/css/daterangepicker-bs3.css';

import "./res/css/myFont/iconfont.eot";
import "./res/css/myFont/iconfont.svg";
import "./res/css/myFont/iconfont.ttf";
import "./res/css/myFont/iconfont.woff";


import VueResource from 'vue-resource';
Vue.use(VueResource);

// http拦截器
import interceptors from './service/interceptors';
Vue.use(interceptors);

// 加载插件
import plugins from './plugins/pluginsVendor'
plugins.init();

//图表可视化echarts
import echarts from 'echarts'
Vue.use(echarts);

//jquery插件jquery-knob
import jqueryKnob from 'jquery-knob'
Vue.use(jqueryKnob);

import 'simple-line-icons/css/simple-line-icons.css'

const router = new VueRouter({
	routes,
	mode: routerMode,
	strict: process.env.NODE_ENV !== 'production'
});
router.beforeEach((to, from, next) => {
  if(to.meta.title) {
    document.title = to.meta.title;
  }
  next();
});

new Vue({
	router,
	store
}).$mount('#app');
